// app.js
import {getSystemInfo} from "utils/asyncWx.js"
App({
  onLaunch() {
    // wx.removeStorageSync('userInfo')
    // wx.removeStorageSync('student')
    // wx.removeStorageSync('openid')
    // wx.removeStorageSync('token')
    this.myGetSystemInfo()
  },
  globalData: {
    baseUrl: 'https://school.xxla.top/',
    domain: '',
    devicetype: '',
    version: '1.0.0'
  },
  getUserInfo () {
    let userInfo = wx.getStorageSync('userInfo')
    // console.log(userInfo)
    if(userInfo) {
      return userInfo
    }
  },
  async myGetSystemInfo () {
    const sysinfosync = await getSystemInfo()
    const platform =  sysinfosync.platform
    // console.log(sysinfosync)
    // console.log(platform)
    this.globalData.devicetype = platform
  },
  getUserInfo () {
    let userInfo = wx.getStorageSync('userInfo')
    if(userInfo) {
      return userInfo
    }
  }
})
